package com.cloudpivot.receivales.ding.scenegroup.view;

import lombok.Getter;
import lombok.Setter;

/**
 * 完成进度
 */
public enum CompletionQuarterEnum {

    ONE("0", "Q1"),
    TWO("1", "Q2"),
    THREE("2", "Q3"),
    FOUR("3", "Q4"),

    ;

    @Getter
    @Setter
    private String k;
    @Getter
    @Setter
    private String v;

    CompletionQuarterEnum(String k, String v) {
        this.k = k;
        this.v = v;
    }

    /**
     * 根据k获取comment
     *
     * @param k
     * @return comment
     */
    public static String getValue(String k) {
        if (k==null) {
            return null;
        }
        for (CompletionQuarterEnum eNum : CompletionQuarterEnum.values()) {
            if (eNum.getK().equals(k)) {
                return eNum.getV();
            }
        }
        return null;
    }

    public static String getKey(String v) {
        if (v==null) {
            return null;
        }
        for (CompletionQuarterEnum eNum : CompletionQuarterEnum.values()) {
            if (eNum.getV().equals(v)) {
                return eNum.getK();
            }
        }
        return null;
    }
}
